/**
 * axios公共内容
 */
import axios from "axios";
const instance = axios.create({
  baseURL: 'http://www.qbzaixian.com:8989',
  timeout: 60000,
});
const checkToken = ()=>{
    let token = localStorage.getItem("admin-token");
    if(token){
        return token;
    }
    return "";
}
instance.defaults.headers.token = checkToken();
// 添加响应拦截器
instance.interceptors.response.use(function (response) {
    // 对响应数据做点什么
    if(response.data.code ==200){

    }
    return response;
  }, function (error) {
    // 对响应错误做点什么
    return Promise.reject(error);
  });
  export default instance;